
"""资金类

:param
startAmount 资金数量
"""


class FUND:
    def __init__(self,startAmount):
        self.count=startAmount
        self.history=[{'time':0,'sumation':self.count}]
    """增加时"""
    def add(self,amount,time):
        self.count = self.count+amount
        self._change(self.count,time)

    """减少时"""
    def reduce(self,amount,time):
        self.count = self.count-amount
        self._change(self.count,time)

    """历史记录"""
    def _change(self,amount,time):
        self.history.append({'time':time,'sumation':amount})